﻿using SurfaceAreaPresenter;
using SurfaceAreaInfrastructure;
using System;

namespace SurfaceAreaCalculationTests
{
    class FakeView : ISurfaceAreaView
    {
        public bool edgeLabelVisible { get; set; }
        public bool radiusLabelVisible { get; set; }
        public bool directionLabelVisible { get; set; }
        public bool edgeTextFieldVisible { get; set; }
        public bool radiusTextFieldVisible { get; set; }
        public bool directionTextFieldVisible { get; set; }
        public bool resultButtonVisible { get; set; }
        public bool resultTextFieldVisible { get; set; }
        public bool errorLabelVisible { get; set; }
        public string resultField { get; set; }
        public string edgeValue { get; set; }
        public string radiusValue { get; set; }
        public string directionValue { get; set; }
        public string errorValue { get; set; }
        public string logText { get; set; }
        public bool logRichTextBoxVisible { get; set; }

        public ILogger getFileLogger()
        {
            return new FileLogger();
        }

        public ILogger getHTMLLogger()
        {
            return new HTMLLogger();
        }

        public event Action cubeButtonPressed;
        public event Action coneButtonPressed;
        public event Action cylinderButtonPressed;
        public event Action sphereButtonPressed;
        public event Action calculateButtonPressed;
        public event Action readLogButtonPressed;
        public event Action<bool> loggerStateChanged;

        public void cubeButtonClick()
        {
            cubeButtonPressed();
        }

        public void coneButtonClick()
        {
            coneButtonPressed();
        }

        public void cylinderButtonClick()
        {
            cylinderButtonPressed();
        }

        public void sphereButtonClick()
        {
            sphereButtonPressed();
        }

        public void resultButtonClick()
        {
            calculateButtonPressed();
        }
        public void readLogButtonClick()
        {
            readLogButtonPressed();
        }

        public void loggerStateChangedTo(bool state)
        {
            loggerStateChanged(state);
        }
    }
}
